from DJCrawtest.getgrad import get_grad
from DJCrawtest.getmodel import raw4,raw48,raw646
import soundfile as sf
from DJCrawtest.calgrad import cal_grad
import matplotlib.pyplot as plt
import numpy as np
fac1=r"F:\Attack-Transferability-On-Synthetic-Detection\DJCrawtest\fake1.flac"
fac2=r"F:\Attack-Transferability-On-Synthetic-Detection\DJCrawtest\fake2.flac"
x1_646,sr=sf.read(fac1)
x2_646,sr=sf.read(fac2)
model_raw646=raw646()
model_raw48=raw48()
#model_raw4=raw4()
#raw4_grad=get_grad(x1_646[:40000],model_raw4)
raw48_grad=get_grad(x1_646[:48000],model_raw48)
raw646_grad=get_grad(x1_646,model_raw646)

raw646_48_grad=raw646_grad[:48000]
plt.plot(raw646_48_grad+raw48_grad)
plt.show()
#cal_grad(raw646_grad,raw48_grad,raw4_grad)






